// [[ OnflowGenerator File UUID: d54d3e53c14847848b72be7d60637af1  ]]
package com.itdct.onflow.system.file.controller

import com.itdct.onflow.core.type.*
import com.itdct.onflow.core.vo.RespPageVo
import com.itdct.onflow.core.vo.RespVo
import com.itdct.onflow.system.common.base.BaseSysController
import com.itdct.onflow.system.file.qo.SysFileFailReasonEditQo
import com.itdct.onflow.system.file.qo.SysFileFailReasonSearchQo
import com.itdct.onflow.system.file.service.SysFileFailReasonService
import com.itdct.onflow.system.file.vo.SysFileFailReasonDetailVo
import com.itdct.onflow.system.file.vo.SysFileFailReasonListVo
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.http.MediaType
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.*

/**
 * @author DCTANT
 * @date 2025-09-28 16:52:23
 * @version 1.0
 * @description 系统文件错误信息接口控制
 */
@Tag(name = SysFileFailReasonController.moduleName)
@RestController
@RequestMapping(value = ["/sysFileFailReason"], produces = [MediaType.APPLICATION_JSON_VALUE], method = [RequestMethod.POST])
class SysFileFailReasonController(
    val sysFileFailReasonService: SysFileFailReasonService
) : BaseSysController() {
    companion object {
        const val moduleName = "系统文件错误信息"
    }

    @Operation(summary = moduleName + "添加")
    @PostMapping("/add.adw")
    fun add(@RequestBody @Validated(Add::class) qo: SysFileFailReasonEditQo): RespVo<Long> {
        return sysFileFailReasonService.add(qo, getContext())
    }

    @Operation(summary = moduleName + "更新")
    @PostMapping("/update.adw")
    fun update(@RequestBody @Validated(Update::class) qo: SysFileFailReasonEditQo): RespVo<Unit> {
        return sysFileFailReasonService.update(qo, getContext())
    }

    @Operation(summary = moduleName + "删除")
    @PostMapping("/delete.adw")
    fun delete(@RequestBody @Validated(Delete::class) qo: SysFileFailReasonEditQo): RespVo<Unit> {
        return sysFileFailReasonService.delete(qo, getContext())
    }

    @Operation(summary = moduleName + "详情")
    @PostMapping("/detail.adw")
    fun detail(@RequestBody @Validated(Detail::class) qo: SysFileFailReasonSearchQo): RespVo<SysFileFailReasonDetailVo> {
        return sysFileFailReasonService.detail(qo, getContext())
    }

    @Operation(summary = moduleName + "列表")
    @PostMapping("/page.adw")
    fun page(@RequestBody @Validated(Page::class) qo: SysFileFailReasonSearchQo): RespPageVo<SysFileFailReasonListVo> {
        return sysFileFailReasonService.page(qo, getContext())
    }

// [[ OnflowGenerator Range (- selectFunctions -) Start ]]

// [[ OnflowGenerator Range (- selectFunctions -) End ]]
}